All Questions
8 questions
3votes
2answers
453views
Pascal's triangle solution in Python code
I have solved the pascal's triangle problem. I am not good at writing efficient programs, hence any suggestions/ comments shall be welcomed. ...
5votes
4answers
452views
Check whether a permutation with one fixed point can be rotated into one with two fixed points
A friend gave me the following riddle: Given n people with n distinct names, you place n names tags on a round table with n seats. If the n people now sit at those seats randomly such that exactly ...
3votes
2answers
272views
Fixed Content Necklace Generator
I wrote a class that generates combinatorial necklaces with fixed content as per Sawada: A fast algorithm to generate necklaces with fixed content. The class is instantiated with an input list that ...
2votes
2answers
982views
Project Euler # 24 Lexicographic permutations in Python
A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we ...
4votes
2answers
2kviews
Steinhaus-Johnson-Trotter Algorithm
I began to program a little while ago and tried to implement my first algorithm: the Steinhaus-Johnson-Trotter algorithm. This algorithm generates a sequence of permutations of \$n\$ elements such ...
6votes
1answer
804views
Computation of product of permutations
Given a graph \$G = (V,E)\$ with a unique labeling of each vertex, let the transposition \$(i,j)\$ (where \$i,j\$ are the labels on adjacent vertices) represent selecting an edge and swapping the ...
8votes
1answer
983views
Recursive search for combinations of words that have a specified MD5 hash
This code solves a challenge problem that a local company is hosting to attract/screen applicants. The link to the challenge is here. In brief, we are given a wordlist containing approximately 100,...
5votes
2answers
528views
Solver for Jumble puzzle
Here is my first attempt to solve Jumble puzzle: ...